package com.laiketui.order.service.impl;

import com.laiketui.order.api.dto.WarehouseDTO;
import com.laiketui.order.entity.StoreOrderEntity;
import com.laiketui.order.service.WarehouseService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WarehouseServiceImpl implements WarehouseService {

    @Override
    public WarehouseDTO getWarehouse() {
        WarehouseDTO warehouseDTO = new WarehouseDTO();
        warehouseDTO.setWarehouseName("珞珂仓");
        warehouseDTO.setProvice("广东省");
        warehouseDTO.setCity("深圳市");
        warehouseDTO.setArea("龙岗区");
        warehouseDTO.setAddress("同乐黄屋路10号珞珂家居");
        warehouseDTO.setName("张三");
        warehouseDTO.setMobile("13800138000");
        return warehouseDTO;
    }

    @Override
    public String getChannel() {
        return "珞珂家居";
    }

    @Override
    public boolean getNeedQualityInspection(Integer mchId) {
        return true;
    }

    @Override
    public String getFactoryName(String orderNo) {

        return getFactoryName();
    }

    private String getFactoryName() {
        return "深圳市珞珂家居有限公司";
    }

    @Override
    public Map<String, String> getFactoryNameMap(List<StoreOrderEntity> entities) {
        HashMap<String, String> map = new HashMap<>(entities.size());
        for (StoreOrderEntity entity : entities) {
            map.put(entity.getOrderNo(), getFactoryName());
        }
        return map;
    }
}
